package com.he1618;

import io.micrometer.core.instrument.DistributionSummary;
import io.micrometer.core.instrument.MeterRegistry;
import org.springframework.stereotype.Service;

@Service
public class MyMSummaryService {
    private final DistributionSummary mySummary;

    public MyMSummaryService(MeterRegistry registry) {
        this.mySummary = DistributionSummary.builder("my.custom.summary")
                                            .register(registry);
    }

    public void recordValue(double value) {
        // 记录需要监控的值
        mySummary.record(value);
    }
}
